package yesjava;

import java.beans.Transient;

public class Teacher {
//     成员变量
    private String name;
    private String sex ;
//    实例方法
    public void say() {
        // System.out.println("老师:" + this.name);
    }
// 构造方法
    public Teacher() {
        System.out.println("Teacher: 默认无参构造!");
    }

//    方法签名： 方法名 + 参数列表
    public void fn1(int a,long b){
        System.out.println("fn1");
//        return a+b;
    }

    public static void fn2(int a){
        System.out.println("fn2");
    }

    public Teacher(String name) {
       // System.out.println("Teacher: 默认有参构造!!!!");
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public Teacher setName(String name) {
        this.name = name;
        return this;
    }

    /*@Deprecated
    @Override*/
//    @Transient
    public String toString() {
        return "Teacher{" +
                "name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                '}';
    }
}
